// 焦点渐变轮播
// 获取元素
var cals = document.getElementsByClassName('cal');
var circle = document.getElementsByClassName('circle');
var calList = document.getElementsByClassName('cal_list');
// 焦点轮播
// 给每一个小方块绑定mouseover
// 小方块样式的排他函数
function backstart() {
    for (var j = 0; j < circle.length; j++) {
        circle[j].className = 'circle';
        // li元素
        cals[j].className = 'cal';
    }
};
// 循环绑定事件
for (var i = 0; i < circle.length; i++) {
    // 设置鼠标经过第几个小方块
    circle[i].index = i;
    circle[i].onmouseover = function () {
        // 排他思想
        backstart();
        // 鼠标放哪个小方块,哪个小方块变白
        this.className = "circle active";
        // 使用绑定index
        cals[this.index].className = 'cal show';
    }
};
function autoplay() {
    src = 0;
    setInterval(function () {
        if (src == 4) {
            src = 0;
            backstart();
            circle[src].className = 'circle active'
            cals[src].className = 'cal show';
        }
        else {
            backstart();
            circle[src].className = 'circle active'
            cals[src].className = 'cal show';
        }
        src++;
    }, 3000)
}
autoplay();